import 'package:flutter/material.dart';
import 'package:wanchong/path.dart';
import 'package:flutter_easyrefresh/easy_refresh.dart';
import 'package:flutter_easyrefresh/bezier_hour_glass_header.dart';
import 'package:flutter_easyrefresh/bezier_bounce_footer.dart';

class Videoselect extends StatefulWidget {
  @override
  _KonwState createState() => _KonwState();
}

class _KonwState extends State<Videoselect> {
  //

  GlobalKey<EasyRefreshState> _easyRefreshKey =
      new GlobalKey<EasyRefreshState>();
  GlobalKey<RefreshHeaderState> _headerKey =
      new GlobalKey<RefreshHeaderState>();
  GlobalKey<RefreshFooterState> _footerKey =
      new GlobalKey<RefreshFooterState>();
  Widget build(BuildContext context) {
    return Container(
      color: Color(0xFFFAFAFA),
      child: Scaffold(
        backgroundColor: Color(0xFFFAFAFA),
        appBar: new PreferredSize(
          child: new Container(
            padding:
                new EdgeInsets.only(top: MediaQuery.of(context).padding.top),
            child: Container(
              height: 100.0,
              color: Colors.white,
              child: Column(
                children: <Widget>[
                  Row(
                    children: <Widget>[
                      GestureDetector(
                        onTap: () {
                          Navigator.pop(context);
                        },
                        child: Container(
                          width: 44.0,
                          height: 44.0,
                          child: Image.asset('assets/login/fanhui@3x.png'),
                        ),
                      ),
                      Expanded(
                        child: Container(
                          child: Text(
                            '顽宠视讯',
                            style: TextStyle(
                              color: Color(0xFF000000),
                              fontSize: 17,
                              fontWeight: FontWeight.w700,
                            ),
                          ),
                          height: 44.0,
                          alignment: Alignment.center,
                        ),
                      ),
                      Container(
                        width: 50.0,
                        height: 44.0,
                      ),
                    ],
                  ),
                  Row(
                    children: <Widget>[
                      Container(
                        width: 15.0,
                        height: 44.0,
                      ),
                      Expanded(
                          child: GestureDetector(
                        onTap: () {
                          Navigator.of(context).pushNamed(InfosearchPath);
                        },
                        child: Container(
                          height: 35,
                          decoration: BoxDecoration(
                            color: Color(0xFFFAFAFA),
                            borderRadius: BorderRadius.circular(5.0),
                          ),
                          child: Row(
                            mainAxisAlignment: MainAxisAlignment.center,
                            crossAxisAlignment: CrossAxisAlignment.center,
                            children: <Widget>[
                              Icon(Icons.search,
                                  color: Color(0xFF647280), size: 20.0),
                              SizedBox(
                                width: 4,
                              ),
                              Text(
                                '搜索',
                                style: new TextStyle(
                                  fontSize: 14,
                                  color: Color(0xFF647280),
                                ),
                              ),
                            ],
                          ),
                        ),
                      )),
                      Container(
                        width: 15.0,
                      ),
                    ],
                  ),
                ],
              ),
            ),
            decoration: new BoxDecoration(
              gradient: new LinearGradient(
                  colors: [Color(0x00000000), Color(0x00000000)],
                  begin: const FractionalOffset(0.0, 0.0),
                  end: const FractionalOffset(1.0, 1.0),
                  stops: [0.0, 1.0],
                  tileMode: TileMode.clamp),
            ),
          ),
          preferredSize: new Size(MediaQuery.of(context).size.width, 150.0),
        ),
        body: Container(
          color: Colors.white,
          margin: EdgeInsets.only(top: 15.0),
          child: EasyRefresh(
            key: _easyRefreshKey,
            behavior: ScrollOverBehavior(),
            refreshHeader: BezierHourGlassHeader(
              key: _headerKey,
              color: Color(0xFFFFCC33),
              backgroundColor: Colors.white,
            ),
            refreshFooter: BezierBounceFooter(
              key: _footerKey,
              color: Color(0xFFFFCC33),
              backgroundColor: Colors.white,
            ),
            onRefresh: () async {
              await new Future.delayed(const Duration(seconds: 1), () {
                setState(() {});
              });
            },
            loadMore: () async {
              await new Future.delayed(const Duration(seconds: 1), () {
                setState(() {});
              });
            },
            child: ListView(
              children: <Widget>[
                Container(
                  height: 240.0,
                  child: Column(
                    children: <Widget>[
                      Container(
                        margin:
                            EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
                        height: 190.0,
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(5.0),
                          image: DecorationImage(
                            image: NetworkImage(
                                'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562903412&di=7f6cf511ba63129c6c68dcf95829a3ed&imgtype=jpg&er=1&src=http%3A%2F%2Fshihuo.hupucdn.com%2Fucditor%2F20171127%2F1600x1066_983d0e59e521344aa37f0e7943ad8aca.jpeg%3FimageMogr2%2Fformat%2Fjpg%257cimageView2%2F2%2Fw%2F700%2Finterlace%2F1'),
                            fit: BoxFit.cover,
                          ),
                        ),
                        child: Container(
                          margin: EdgeInsets.only(
                              left: 10.0, right: 10.0, top: 150.0),
                          child: Row(
                            children: <Widget>[
                              Expanded(
                                child: Container(
                                  child: Text(
                                    '幼年柯基需要断尾吗？幼年柯基需要断尾吗？幼年柯基需要断尾吗？幼年柯基需要断尾吗？',
                                    overflow: TextOverflow.ellipsis,
                                    style: TextStyle(
                                      color: Colors.white,
                                      fontWeight: FontWeight.w700,
                                      fontSize: 17.0,
                                    ),
                                  ),
                                ),
                              ),
                              Container(
                                width: 20.0,
                                height: 20.0,
                                child: Image.asset(
                                  'assets/user/play-icon.png',
                                  fit: BoxFit.contain,
                                ),
                              ),
                              Container(
                                child: Text(
                                  '03:15',
                                  overflow: TextOverflow.ellipsis,
                                  style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 12.0,
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        height: 39.0,
                        margin: EdgeInsets.only(left: 25.0),
                        child: Text(
                          '顽宠管家 525 浏览 378 赞同',
                          style: TextStyle(
                            color: Color(0xFFB4BEC6),
                            fontSize: 12.0,
                          ),
                        ),
                      ),
                      Container(
                        height: 0.5,
                        margin: EdgeInsets.only(left: 15.0, right: 15.0),
                        color: Color(0xFFDBDBDB),
                      )
                    ],
                  ),
                ),
                Container(
                  height: 240.0,
                  child: Column(
                    children: <Widget>[
                      Container(
                        margin:
                            EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
                        height: 190.0,
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(5.0),
                          image: DecorationImage(
                            image: NetworkImage(
                                'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562903412&di=7f6cf511ba63129c6c68dcf95829a3ed&imgtype=jpg&er=1&src=http%3A%2F%2Fshihuo.hupucdn.com%2Fucditor%2F20171127%2F1600x1066_983d0e59e521344aa37f0e7943ad8aca.jpeg%3FimageMogr2%2Fformat%2Fjpg%257cimageView2%2F2%2Fw%2F700%2Finterlace%2F1'),
                            fit: BoxFit.cover,
                          ),
                        ),
                        child: Container(
                          margin: EdgeInsets.only(
                              left: 10.0, right: 10.0, top: 150.0),
                          child: Row(
                            children: <Widget>[
                              Expanded(
                                child: Container(
                                  child: Text(
                                    '幼年柯基需要断尾吗？幼年柯基需要断尾吗？幼年柯基需要断尾吗？幼年柯基需要断尾吗？',
                                    overflow: TextOverflow.ellipsis,
                                    style: TextStyle(
                                      color: Colors.white,
                                      fontWeight: FontWeight.w700,
                                      fontSize: 17.0,
                                    ),
                                  ),
                                ),
                              ),
                              Container(
                                width: 20.0,
                                height: 20.0,
                                child: Image.asset(
                                  'assets/user/play-icon.png',
                                  fit: BoxFit.contain,
                                ),
                              ),
                              Container(
                                child: Text(
                                  '03:15',
                                  overflow: TextOverflow.ellipsis,
                                  style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 12.0,
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        height: 39.0,
                        margin: EdgeInsets.only(left: 25.0),
                        child: Text(
                          '顽宠管家 525 浏览 378 赞同',
                          style: TextStyle(
                            color: Color(0xFFB4BEC6),
                            fontSize: 12.0,
                          ),
                        ),
                      ),
                      Container(
                        height: 0.5,
                        margin: EdgeInsets.only(left: 15.0, right: 15.0),
                        color: Color(0xFFDBDBDB),
                      )
                    ],
                  ),
                ),
                Container(
                  height: 240.0,
                  child: Column(
                    children: <Widget>[
                      Container(
                        margin:
                            EdgeInsets.only(left: 15.0, right: 15.0, top: 10.0),
                        height: 190.0,
                        decoration: BoxDecoration(
                          borderRadius: BorderRadius.circular(5.0),
                          image: DecorationImage(
                            image: NetworkImage(
                                'https://timgsa.baidu.com/timg?image&quality=80&size=b9999_10000&sec=1562903412&di=7f6cf511ba63129c6c68dcf95829a3ed&imgtype=jpg&er=1&src=http%3A%2F%2Fshihuo.hupucdn.com%2Fucditor%2F20171127%2F1600x1066_983d0e59e521344aa37f0e7943ad8aca.jpeg%3FimageMogr2%2Fformat%2Fjpg%257cimageView2%2F2%2Fw%2F700%2Finterlace%2F1'),
                            fit: BoxFit.cover,
                          ),
                        ),
                        child: Container(
                          margin: EdgeInsets.only(
                              left: 10.0, right: 10.0, top: 150.0),
                          child: Row(
                            children: <Widget>[
                              Expanded(
                                child: Container(
                                  child: Text(
                                    '幼年柯基需要断尾吗？幼年柯基需要断尾吗？幼年柯基需要断尾吗？幼年柯基需要断尾吗？',
                                    overflow: TextOverflow.ellipsis,
                                    style: TextStyle(
                                      color: Colors.white,
                                      fontWeight: FontWeight.w700,
                                      fontSize: 17.0,
                                    ),
                                  ),
                                ),
                              ),
                              Container(
                                width: 20.0,
                                height: 20.0,
                                child: Image.asset(
                                  'assets/user/play-icon.png',
                                  fit: BoxFit.contain,
                                ),
                              ),
                              Container(
                                child: Text(
                                  '03:15',
                                  overflow: TextOverflow.ellipsis,
                                  style: TextStyle(
                                    color: Colors.white,
                                    fontSize: 12.0,
                                  ),
                                ),
                              ),
                            ],
                          ),
                        ),
                      ),
                      Container(
                        alignment: Alignment.centerLeft,
                        height: 39.0,
                        margin: EdgeInsets.only(left: 25.0),
                        child: Text(
                          '顽宠管家 525 浏览 378 赞同',
                          style: TextStyle(
                            color: Color(0xFFB4BEC6),
                            fontSize: 12.0,
                          ),
                        ),
                      ),
                      Container(
                        height: 0.5,
                        margin: EdgeInsets.only(left: 15.0, right: 15.0),
                        color: Color(0xFFDBDBDB),
                      )
                    ],
                  ),
                ),
              ],
            ),
          ),
        ),
      ),
    );
  }
}
